package system

import (
	"context"
	"strconv"
	"time"

	"private-domain-overseas-service/app/business/api/internal/svc"
	"private-domain-overseas-service/app/business/api/internal/types"

	"github.com/zeromicro/go-zero/core/logx"
)

type SystemServiceDateLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

// NewSystemServiceDateLogic - 获取服务器时间（天/秒级）
func NewSystemServiceDateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SystemServiceDateLogic {
	return &SystemServiceDateLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *SystemServiceDateLogic) SystemServiceDate() (resp *types.SystemServiceDateResponse, err error) {
	return &types.SystemServiceDateResponse{
		Date: strconv.FormatInt(time.Now().Unix(), 10),
	}, nil
}
